<template>
  <ych-modal
    :fullscreen="false"
    :title="title"
    :visible="visible"
    :destroyOnClose="true"
    @cancel="handleCancel"
    :cancelText="$t('m.common.button.close')">

    <AssigneeMaxCompletedTaskCountTopDetail ref="detail" :beginDate="beginDate" :endDate="endDate" :groupIds="groupIds" @refreshParent="refreshParent"/>
  </ych-modal>
</template>

<script>

  import { FormDialogMixin } from '@/mixins/FormDialogMixin'
  import AssigneeMaxCompletedTaskCountTopDetail from './AssigneeMaxCompletedTaskCountTopDetail'

  export default {
    name: 'AssigneeMaxCompletedTaskCountTopDialog',
    mixins: [FormDialogMixin],
    components: {
      AssigneeMaxCompletedTaskCountTopDetail
    },
    props: {
      beginDate: {
        type: String,
        required: false
      },
      endDate: {
        type: String,
        required: false
      },
      groupIds:{
        type: String,
        required: false
      },
    },
    data () {
      return {
        title: this.$t('m.common.label.operate'),
      }
    },
    methods: {
      loadData(userId) {
        this.visible = true
        this.$nextTick(() => {
          this.$refs.detail.loadData(1,userId)
        })
      },
    },
  }
</script>
